
//
//  SSSUploadMerchantViewController.m
//  SSSAllRollAgency
//
//  Created by 谢曦 on 2017/3/14.
//  Copyright © 2017年 Darker. All rights reserved.
//

#import "SSSInfoBaseTableViewController.h"

@interface SSSInfoBaseTableViewController ()
@end

@implementation SSSInfoBaseTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor whiteColor];
    [self tableView];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 1;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    return [UITableViewCell new];
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return kFooterH;
}

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return kHeaderH;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return kRowH*4+4;
}
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
    [self.view endEditing:YES];
}
#pragma mark - action

#pragma mark - public

-(void)footerButtonClick{
    [self.view endEditing:YES];
    
    

}
//-(void)submitWithArr:(NSArray<SSSCellBaseConfigModel *> *)dataArr completeBlock:(void (^)())completeBlock{
//
//    [self isCompleteWithArr:dataArr];
//    completeBlock();
////    [self isCompleteWithArr:dataArr]==YES?completeBlock():[NSObject showHudTipStr:@"请先完善信息"];
//}
//-(void)submitWithArr:(NSArray<SSSCellBaseConfigModel *> *)dataArr completeBlock:(void (^)())completeBlock incompleteBlock:(void (^)())incompleteBlock{
//    [self isCompleteWithArr:dataArr]==YES?completeBlock():incompleteBlock();
//}
-(UIView *)headerWithTitle:(NSString *)title
{
    UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 0, KSCREEN_Width, 38)];
    view.backgroundColor=[UIColor clearColor];
    UILabel *lable=[UILabel new];
    lable.textColor=[UIColor colorWithHex:@"6D6D6D"];
    lable.font=Font(15);
    [view addSubview:lable];
    lable.text=title;
    [lable sizeToFit];
    [lable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(view);
        make.left.mas_equalTo(15);
        
    }];
    return view;
    
    
}
-(UIView *)buttonFooterWithTitle:(NSString *)title
{
    
    UIView *footer=[[UIView alloc] initWithFrame:CGRectMake(0, 0, KSCREEN_Width, 100)];
    UIButton *submitBtn=[[UIButton alloc] init];
    submitBtn.layer.cornerRadius=4;
    submitBtn.backgroundColor=ThemeGreenColor;
    [submitBtn setTitle:title forState:UIControlStateNormal];
    [submitBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    
    [submitBtn addTarget:self action:@selector(footerButtonClick) forControlEvents:UIControlEventTouchUpInside];
    [footer addSubview:submitBtn];
   
    
    [submitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.center.equalTo(footer);
        make.size.mas_equalTo(CGSizeMake(291, 51));
    }];
  
    return footer ;
}

#pragma mark - private
//-(BOOL )isCompleteWithArr:(NSArray *)arr{
//    __block bool iscomplete=YES;
//    [arr enumerateObjectsUsingBlock:^(CellBaseConfigModel  *model, NSUInteger idx, BOOL * _Nonnull stop) {
//        if (model.rightText.length==0||!model.rightText) {
//            iscomplete=NO;
//            *stop=YES;
//        }
//        else{
//            [[SSSAuditDetailModelManager sharedManager] updateValue:model.rightText forKey:model.identifier];
//        }
//        
//    }];
//    NSDictionary *infoDict=[SSSAuditDetailModelManager sharedManager].infoDict;
//    NSLog(@"-----%@",infoDict);
//    return iscomplete;
//
//}
-(UITableView *)tableView
{
    if (!_tableView) {
        _tableView=[[UITableView alloc] initWithFrame:CGRectMake(0, 64, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) style:UITableViewStyleGrouped];
       _tableView.backgroundColor=[UIColor colorWithHex:@"F6F6F6"];
//        _tableView.separatorStyle=UITableViewCellSeparatorStyleNone;
        _tableView.delegate=self;
        _tableView.dataSource=self;
        [self.view addSubview:_tableView];
    }
    
    return _tableView;
    
}

@end
